Methods and systems for improved quality inspection of products using a robot

ABSTRACT

A method of improved quality inspection includes (i) receiving a first command to capture a first image of a surface of a product, (ii) positioning, by actuating a plurality of rotatable joints, a camera at a first position that is substantially adjacent to the surface of the product, and capturing the first image of the surface of the product. The method further includes, after capturing the first image: (i) processing the first image to identify a defect in the first image and a relative location of the defect in the first image, and (ii) determining a second position of the camera in accordance with the first position of the camera and the relative location of the defect in the first image, and (iii) repositioning, by actuating the plurality of rotatable joints, the camera from the first position to the second position. The method further includes capturing the second image.

TECHNICAL FIELD

This relates generally to production lines, including but not limited tovisually inspecting products on production lines.

BACKGROUND

Manufacturers implement various quality control measures to reduce anamount of defective products entering the stream of commerce. Somequality control measures involve visually inspecting products. However,current visual inspection techniques, such as visual inspections byhuman workers, invariably miss defective products and also lackprocedures to account for new product defects (e.g., product defectscaused by an aging production line). As such, challenges exist ininitially identifying product defects, especially product defects thatdevelop over time.

SUMMARY

Accordingly, there is a need for methods and systems for identifyingdefective products before the defective products enter the stream ofcommerce. One solution to the problem is using a robot (e.g., a roboticarm 402 with a camera 408 mounted on an end of the robotic arm 402, FIG.4A) to visual inspect a product prior to the product entering the streamof commerce. In doing so, the robot can examine relevant surfaces and/orfeatures of the product (or in some situations, each surface and/orfeature of the product). Moreover, if the robot identifies anabnormality during an initial inspection of the product (e.g., an imagecaptured by the robot includes an abnormality, such as a productdefect), the robot is capable of performing a more exacting inspectionof the product (e.g., reposition itself to focus on the abnormality). Inthis way, a manufacturer is able to further reduce an amount ofdefective products entering the stream of commerce by leveraging theprecision and accuracy of a robot and also the processing power of acomputer associated with the robot. Additionally, the robot can create adefect database for each identified defect, which it can then use toidentify defects on future products. A method of operating one suchrobot is described below.

(A1) In some implementations, a method of improved quality inspectionincludes, at a robotic arm (e.g., robotic arm 300, FIG. 3; robotic arm402, FIG. 4A) having a plurality of segments, a camera at an end of therobotic arm, a plurality of rotatable joints, each rotatable jointconnecting two segments of the plurality of segments or the camera withone segment of the plurality of segments, one or more processors, andmemory storing instructions for execution by the processors, (i)receiving a command to capture a first image of a surface of a product,(ii) positioning, by actuating the plurality of rotatable joints, thecamera at a first position that is substantially adjacent to the surfaceof the product, and capturing, via the camera, the first image of thesurface of the product with the camera positioned at the first position.The method further includes, after capturing the first image: (i)processing the first image to identify a defect in the first image and arelative location of the defect in the first image, and (ii) determininga second position of the camera in accordance with the first position ofthe camera and the relative location of the defect in the first image,and (iii) repositioning, by actuating the plurality of rotatable joints,the camera from the first position to the second position. The secondposition has a different spatial relationship to the surface of theproduct than the first position. The method further includes capturing,via the camera, the second image of the surface of the product with thecamera positioned at the second position.

(A2) In some implementations of the method of A1, the camera isseparated from the surface by a first distance when positioned at thefirst position, the camera is separated from the surface by a seconddistance when repositioned at the second position, and the seconddistance is less than the first distance.

(A3) In some implementations of the method of any of A1-A2, the camerais set at a first focal length when positioned at the first position,the camera is set at a second focal length when repositioned at thesecond position, and the second focal length is greater than the firstfocal length.

(A4) In some implementations of the method of any of A1-A3, the methodfurther includes determining a size of the product from the first imageof the surface of the product and the first position of the camera, andbased on the determined size, assigning a working space for the roboticarm. The size may include one or more of the product's height, width,length, and volume. In some implementations, the working space for therobotic arm is further determined based on a configuration of therobotic arm. For example, a robotic arm having a first configuration(e.g., robotic arm 402, FIG. 4A) may be assigned a first working space(e.g., using a first working space equation) and a robotic arm having asecond configuration (e.g., robotic arm 440, FIG. 4C) may be assigned asecond working space (e.g., using a second working space equation).

(A5) In some implementations of the method of any of A1-A4, positioningthe camera at the first position and repositioning the camera from thefirst position to the second position is performed within the workingspace determined for the robotic arm.

(A6) In some implementations of the method of any of A1-A5, theplurality of rotatable joints provides the robotic arm with four degreesof freedom (e.g., the robotic arm 402 has, at least in someimplementations, four degrees of freedom).

(A7) In some implementations of the method of any of A1-A5, theplurality of rotatable joints provides the robotic arm with five degreesof freedom (e.g., the robotic arm 420 has, at least in someimplementations, five degrees of freedom).

(A8) In some implementations of the method of any of A1-A7, a first setof rotatable joints in the plurality of rotatable joints rotate about afirst axis, and a second set of rotatable joints in the plurality ofrotatable joints rotate about a second axis.

(A9) In some implementations of the method of any of A1-A8, the firstset of rotatable joints is body rotatable joints (e.g., rotatable joints406-B and 406-C, FIG. 4A), and the second set of rotatable joints is endrotatable joints (e.g., rotatable joints 406-A and 406-D, FIG. 4A).

(A10) In some implementations of the method of any of A1-A9, the methodfurther includes: (i) repositioning, by actuating the plurality ofrotatable joints, the camera at one or more additional positions, eachadditional position is substantially adjacent to a respective additionalsurface of the product, and (ii) capturing, via the camera, anadditional image of each respective additional surface of the productwith the camera positioned at the one or more additional positions.

(A11) In some implementations of the method of any of A1-A10, theproduct is positioned on a rotatable base (e.g., rotatable base 410,FIG. 4A). Moreover, the method further includes, after capturing thefirst image, rotating the rotatable base in accordance with the relativelocation of the defect in the first image. The second image is capturedafter rotating the rotatable base.

(A12) In another aspect, a robotic arm is provided (e.g., robotic arm300, FIG. 3). The robotic arm includes a plurality of segments, a cameraat an end of the robotic arm, a plurality of rotatable joints, eachrotatable joint connecting two segments of the plurality of segments orthe camera with one segment of the plurality of segments, one or moreprocessors, and memory storing one or more programs, which when executedby the one or more processors cause the robotic arm to perform themethod described in any one of A1-A11.

(A13) In yet another aspect, a robotic arm is provided and the roboticarm includes means for performing the method described in any one ofA1-A11.

(A14) In still another aspect, a non-transitory computer-readablestorage medium is provided. The non-transitory computer-readable storagemedium stores executable instructions that, when executed by a roboticarm (e.g., robotic arm 300, FIG. 3) with one or more processors/cores,cause the robotic arm to perform the method described in any one ofA1-A11.

BRIEF DESCRIPTION OF THE DRAWINGS

For a better understanding of the various described implementations,reference should be made to the Description of Implementations below, inconjunction with the following drawings in which like reference numeralsrefer to corresponding parts throughout the figures and specification.

FIG. 1 is a block diagram illustrating an exemplary network architectureof a product inspection network, in accordance with someimplementations.

FIG. 2 is a block diagram illustrating an exemplary server system, inaccordance with some implementations.

FIG. 3 is a block diagram illustrating an exemplary robotic arm, inaccordance with some implementations.

FIG. 4A is an exemplary robotic arm that is used to inspect a product,in accordance with some implementations.

FIG. 4B is an exemplary robotic arm that is used to inspect a product,in accordance with some implementations.

FIG. 4C is an exemplary robotic arm that is used to inspect a product,in accordance with some implementations.

FIGS. 5A-5B show a robotic arm capturing a first image of a product anda resulting image with a defect, in accordance with someimplementations.

FIGS. 5C-5D show the robotic arm capturing a second image of the productand a resulting image with the defect, in accordance with someimplementations.

FIGS. 6A-6B show a defect model and a new defect being added to thedefect model, in accordance with some implementations.

FIG. 7 is a flow diagram illustrating a method of improved qualityinspection, in accordance with some implementations.

DESCRIPTION OF IMPLEMENTATIONS

Reference will now be made to implementations, examples of which areillustrated in the accompanying drawings. In the following description,numerous specific details are set forth in order to provide anunderstanding of the various described implementations. However, it willbe apparent to one of ordinary skill in the art that the variousdescribed implementations may be practiced without these specificdetails. In other instances, well-known methods, procedures, components,circuits, and networks have not been described in detail so as not tounnecessarily obscure aspects of the implementations.

It will also be understood that, although the terms first, second, etc.are, in some instances, used herein to describe various elements, theseelements should not be limited by these terms. These terms are used onlyto distinguish one element from another. For example, a first imagecould be termed a second image, and, similarly, a second image could betermed a first image, without departing from the scope of the variousdescribed implementations. The first image and the second image are bothimages, but they are not the same images.

The terminology used in the description of the various describedimplementations herein is for the purpose of describing particularimplementations only and is not intended to be limiting. As used in thedescription of the various described implementations and the appendedclaims, the singular forms “a,” “an,” and “the” are intended to includethe plural forms as well, unless the context clearly indicatesotherwise. It will also be understood that the term “and/or” as usedherein refers to and encompasses any and all possible combinations ofone or more of the associated listed items. It will be furtherunderstood that the terms “includes,” “including,” “comprises,” and/or“comprising,” when used in this specification, specify the presence ofstated features, integers, steps, operations, elements, and/orcomponents, but do not preclude the presence or addition of one or moreother features, integers, steps, operations, elements, components,and/or groups thereof.

As used herein, the term “if” is, optionally, construed to mean “when”or “upon” or “in response to determining” or “in response to detecting”or “in accordance with a determination that,” depending on the context.Similarly, the phrase “if it is determined” or “if [a stated conditionor event] is detected” is, optionally, construed to mean “upondetermining” or “in response to determining” or “upon detecting [thestated condition or event]” or “in response to detecting [the statedcondition or event]” or “in accordance with a determination that [astated condition or event] is detected,” depending on the context.

As used herein, the term “exemplary” is used in the sense of “serving asan example, instance, or illustration” and not in the sense of“representing the best of its kind.”

FIG. 1 is a block diagram illustrating an exemplary network architecture100 of a product inspection network, in accordance with someimplementations. The network architecture 100 includes a number of edgedevices 102-1, 102-2, . . . 102-n communicably connected to a serversystem 104 by one or more networks 106.

In some implementations, the edge devices 102-1, 102-2, . . . 102-n areelectronic devices that can communicate with the server system 104, eachother, and other devices. In some implementations, the server system 104is a single computing device such as a computer server, while in otherimplementations, the server system 104 is implemented by multiplecomputing devices working together to perform the actions of a serversystem (e.g., cloud computing). In some implementations, the serversystem 104 is at one (or each) of the edge devices 102-1, 102-2, . . .102-n. In such implementations, the server system 104 is a computer atthe respective edge device (i.e., the server system 104 is a localcomputer and/or is part of the respective edge device). In someimplementations, the network 106 is a public communication network(e.g., the Internet or a cellular data network), a privatecommunications network (e.g., private LAN or leased lines), or acombination of such communication networks.

The edge devices 102-1, 102-2, . . . 102-n are used to inspect (e.g.,monitor) products. In some implementations, the edge devices 102-1,102-2, . . . 102-n monitor an operation's effect on a product (e.g.,perform quality control). To do this, each of the edge devices 102-1,102-2, . . . 102-n includes one or more capture devices, such as acamera, an infrared camera, an X-ray camera, a depth camera, etc. Thegoal being that the edge devices 102-1, 102-2, . . . 102-n identifyproduct defects or collect data that can be used to identify productdefects.

In some implementations, an edge device 102 is a robotic arm with acamera attached to an end of the robotic arm (e.g., robotic arm 402,FIG. 4A). Although multiple edge devices are shown in FIG. 1, in someimplementations, a single edge device is in communication with theserver system 104.

In some implementations, the edge devices 102-1, 102-2, . . . 102-n sendthe captured data to the server system 104. The server system 104 canthen use the received data to evaluate a product for product defects.Alternatively, in some implementations, the edge devices 102-1, 102-2, .. . 102-n evaluate a product for product defects locally (e.g., in thoseimplementations where the server system 104 is a computer at the edgesdevices 102-1, 102-2, . . . 102-n).

FIG. 2 is a block diagram illustrating an exemplary server system 200 inaccordance with some implementations. In some implementations, theserver system 200 is an example of a server system 104 (FIG. 1). Asnoted above, in some implementations, the server system 104 is distinctand separate from the edge devices 102-1, 102-2, . . . 102-n.Alternatively, in some implementations, the server system 104 is part ofthe edge devices 102-1, 102-2, . . . 102-n (or part of a respective edgedevice).

The server system 200 typically includes one or more processing units(processors or cores) 202, one or more network or other communicationsinterfaces 204, memory 206, and one or more communication buses 208 forinterconnecting these components. The communication buses 208 optionallyinclude circuitry (sometimes called a chipset) that interconnects andcontrols communications between system components. The server system 200optionally includes a user interface (not shown). The user interface, ifprovided, may include a display device and optionally includes inputssuch as a keyboard, mouse, trackpad, and/or input buttons. Alternativelyor in addition, the display device includes a touch-sensitive surface,in which case the display is a touch-sensitive display.

Memory 206 includes high-speed random access memory, such as DRAM, SRAM,DDR RAM, or other random access solid state memory devices; and mayinclude non-volatile memory, such as one or more magnetic disk storagedevices, optical disk storage devices, flash memory devices, or othernon-volatile solid state storage devices. Memory 206 may optionallyinclude one or more storage devices remotely located from theprocessor(s) 202. Memory 206, or alternately the non-volatile memorydevice(s) within memory 206, includes a non-transitory computer readablestorage medium. In some implementations, memory 206 or the computerreadable storage medium of memory 206 stores the following programs,modules, and data structures, or a subset or superset thereof:

-   -   an operating system 210 that includes procedures for handling        various basic system services and for performing        hardware-dependent tasks;    -   a network communication module 212 that is used for connecting        the server system 200 to other computers (e.g., robotic arm 300,        FIG. 3) via the one or more communication network interfaces 204        (wired or wireless) and one or more communication networks 106        (FIG. 1), such as the Internet, cellular telephone networks,        mobile data networks, other wide area networks, local area        networks, metropolitan area networks, and so on;    -   an image inspection module 214 that is used for processing data        received from one or more edge devices and that is used for        analyzing the processed data. In some implementations, the        visual inspection module compares the processed data with defect        model(s) 220 (e.g., defect table 600, FIG. 6A);    -   a reporting module 216 that is used for recording and reports        defects; and    -   a server database 218 for storing data associated with the        server system, such as:        -   one or more defect models 220;        -   one or more criteria and thresholds 222; and        -   content 224.

In some implementations, the one more defect models 220 includepreviously identified defects and/or desired results (i.e., non-defectpixels).

The one or more criteria and thresholds 222 can include thresholds foridentifying a defect. For example, a threshold difference (or thresholdsimilarity) between a piece of an image captured and a defect pixelincluded in a defect model 220. Additionally, in some implementations,an image is not deemed to include a defect until a threshold number ofpieces of the image are deemed to include defects.

The content 224 can include data received from the robotic arm 300 (FIG.3), such as images captured by the robotic arm. In some implementations,the content 230 includes text (e.g., ASCII, SGML, HTML), images (e.g.,jpeg, tif and gif), graphics (e.g., vector-based or bitmap), audio,video (e.g., mpeg), other multimedia, and/or combinations thereof.

The server database 218 stores data associated with the server system200 in one or more types of databases, such as text, graph, dimensional,flat, hierarchical, network, object-oriented, relational, and/or XMLdatabases.

In some implementations, the server system 200 stores in memory a graphof the edge devices. For example, the graph identifies each edge deviceon a particular production line and connections between each edgedevice. The connections may include a position of the edge device, anorientation of the edge device, neighboring edge devices, etc.

FIG. 3 is a block diagram illustrating an exemplary robotic arm 300, inaccordance with some implementations. The robotic arm 300 is an exampleof one of the one or more edge devices 102-1, 102-2, . . . 102-n (FIG.1). The robotic arm 300 typically includes one or more processing units(processors or cores) 302, one or more network or other communicationsinterfaces 304, memory 306, one or more communication buses 308 forinterconnecting these components, and actuators 309 (e.g., rotatablejoints 406-A-406-D, FIG. 4A). The communication buses 308 optionallyinclude circuitry (sometimes called a chipset) that interconnects andcontrols communications between system components. The robotic arm 300optionally includes a location detection device 310, such as a GNSS(e.g., GPS, GLONASS, etc.) or other geo-location receiver, fordetermining the location of the robotic arm 300. The robotic arm 300also includes one or more capture devices 312, such as a camera, aninfrared camera, an X-ray camera, a depth camera, a three-dimensionalcamera, and the like.

In some implementations, the robotic arm 300 includes one or moreoptional sensors (e.g., gyroscope, accelerometer) for detecting motionand/or a change in orientation of the robotic arm 300. In someimplementations, the detected motion and/or orientation of the roboticarm 300 is used during positioning of the robotic arm 300, or toindicate that the robotic arm 300 requires adjusting or realigning.

In some implementations, the robotic arm 300 includes, or controls, arotatable base 311 (e.g., rotatable base 410, FIG. 4A). In someimplementations, the robotic arm 300 communicates with the rotatablebase 311 via the one or more communication buses 308. Alternatively, insome implementations, the robotic arm 300 communicates with therotatable base 311 via communication interface(s) 304 and communicationinterface 313, respectively. In some implementations, the server system200 controls the rotatable base 311.

Memory 306 includes high-speed random-access memory, such as DRAM, SRAM,DDR RAM, or other random-access solid-state memory devices; and mayinclude non-volatile memory, such as one or more magnetic disk storagedevices, optical disk storage devices, flash memory devices, or othernon-volatile solid-state storage devices. Memory 306 may optionallyinclude one or more storage devices remotely located from theprocessor(s) 306. Memory 306, or alternately the non-volatile memorydevice(s) within memory 306, includes a non-transitory computer-readablestorage medium. In some implementations, memory 306 or thecomputer-readable storage medium of memory 306 stores the followingprograms, modules, and data structures, or a subset or superset thereof:

-   -   an operating system 314 that includes procedures for handling        various basic system services and for performing        hardware-dependent tasks;    -   a network communication module 316 that is used for connecting        the robotic arm 300 to other computers (e.g., other edge        devices, the server system 200, the rotatable base 311) via the        one or more communication network interfaces 304 (wired or        wireless) and the one or more communication networks 106 (FIG.        1), such as the Internet, cellular telephone networks, mobile        data networks, other wide area networks, local area networks,        metropolitan area networks, and so on;    -   a positioning module 318 that is used for controlling the        actuators 309 and positioning a capture device 312 in proximity        to a product;    -   a capture module 320 that is used for controlling the capture        device(s) 312 and processing a respective image or video (or        other data) captured by the capture device(s) 312;    -   a location detection module 322 (e.g., a GPS, Wi-Fi, or hybrid        positioning module) that is used for determining the location of        the robotic arm 300 (e.g., using the location detection device        310) and providing this location information to other edge        devices and/or the server system 200;    -   an image inspection module 324 that is used for detecting        product defects using data captured by the capture devices 312;        and    -   a database 326 for storing data associated with the robotic arm        300, such as:        -   one or more defect models 328;        -   content 330; and        -   movement algorithms and other equations 332.

In some implementations, the positioning module 318 includes a rotatablebase module 334 that is used for controlling (i.e., rotating) therotatable base 311. As discussed in more detail below, the rotatablebase module 334 rotates the rotatable base 311 according to a locationof a defect identified in an image captured by the capture device(s)312. Moreover, in some implementations, the rotatable base module 334rotates the rotatable base 311 to an initial position prior to capturingthe image (e.g., the first image 500, FIG. 5B).

In some implementations, the one more defect models 328 includepreviously identified defects and/or desired results (i.e., non-defectpixels). The one or more defect models 328 are discussed in furtherdetail below with reference to FIG. 5B and FIGS. 6A-6B.

In some implementations, the content 330 includes data captured by thecapture device(s) 312. In some implementations, the content 334 includestext (e.g., ASCII, SGML, HTML), images (e.g., jpeg, tif and gif),graphics (e.g., vector-based or bitmap), audio, video (e.g., mpeg),other multimedia, and/or combinations thereof. Moreover, in someimplementations, the content 330 includes local binary patterns (LBP)generated by the robotic arm 300.

In some implementations, the movement algorithms 332 are forward andinverse kinematic equations. The forward and inverse kinematic equationsare used to identify a position of an end effector (or end effectors) ofthe robotic arm 300 and determine joint parameters that provide adesired position for each of the robotic arm's end-effectors,respectively. The other equations 332 may include working spaceequations and searching route equations, each of which are described infurther detail below.

Each of the above identified modules and applications correspond to aset of executable instructions for performing one or more functions asdescribed above and/or in the methods described in this application(e.g., the computer-implemented methods and other information processingmethods described herein). These modules (i.e., sets of instructions)need not be implemented as separate software programs, procedures ormodules, and thus various subsets of these modules are, optionally,combined or otherwise re-arranged in various implementations. In someimplementations, memory 206 and/or 306 store a subset of the modules anddata structures identified above. Furthermore, memory 206 and/or 306optionally store additional modules and data structures not describedabove.

FIGS. 4A-4C show exemplary robotic arms used to inspect products, inaccordance with some implementations.

FIG. 4A is an exemplary robotic arm 402 used to inspect a product 412,in accordance with some implementations. As shown, the robotic arm 402is part of a production line 400, which also includes a rotatable base410 and a product 412 disposed on top of the rotatable surface 410. Therobotic arm 402 is an example of the robotic arm 300 (FIG. 3). It shouldbe noted that the robotic arm 402 can be used to inspect a wide arrangeof products, and the product 412 is merely one example.

The robotic arm 402 includes a plurality of segments (or sections)404-A, 404-B, and 404-C. In some implementations, a length of each ofthe plurality of segments 404-A, 404-B, and 404-C is substantially thesame. Alternatively, in some implementations, a length of at least onesegment of the plurality of segments 404-A, 404-B, and 404-C differsfrom lengths of other segments of the plurality of segments. The lengthsshown in FIG. 4A are simply used for illustrative purposes and are notlimiting. For example, even though the second segment 404-B is shown tobe shorter than the first segment 404-A, in some implementations, thesecond segment 404-B is longer than the first segment 404-A (the thirdsegment 404-C may also be longer or shorter than the other segments,depending on the circumstances). The robotic arm 402 is shown to includethree segments, however, the robotic arm 402 can include various numbersof segments (e.g., two segments, four segments, . . . N-segments).

The robotic arm 402 also includes a plurality of rotatable joints406-A-406-D (e.g., actuators 309, FIG. 3). In some implementations, anumber of rotatable joints included in the plurality of rotatable joints406-A-406-D corresponds to a number of segments in the plurality ofsegments 404-A, 404-B, and 404-C (e.g., the number of rotatable jointsin the plurality is one greater than the number of the plurality ofsegments). As shown, the first rotatable joint 406-A rotates about afirst axis of rotation (e.g., Y-axis), the second rotatable joint 406-Band the third rotatable joint 406-C rotate about a second axis ofrotation (e.g., Z-axis), and the fourth rotatable joint 406-D rotatesabout one or more of the first axis of rotation and the second axis ofrotation. In some implementations, the fourth rotatable joint 406-D alsorotates about a third axis of rotation (e.g., X-axis). It should benoted that the rotatable joints can rotate clockwise and/orcounterclockwise, and the arrows used in FIGS. 4A-4C should not beconstrued as limiting a rotatable joints' direction of rotation.

As shown, each rotatable joint 406 connects either: (i) two segments ofthe plurality of segments 404, or (ii) a camera 408 (discussed below) ofthe robotic arm 402 with one segment of the plurality of segments 404.In such an arrangement, the robotic arm 402 is composed of substantiallycontiguous segments.

The robotic arm 402 also includes a camera 408 (e.g., a capture device312, FIG. 3) attached to an end of the robotic arm. The robotic arm 402(or a component thereof such as processor(s) 302 or capture module 320,FIG. 3) controls operation of the camera 408. For example, as will bediscussed in further detail above, the robotic arm 402 captures an imageof the product 412, via the camera 408, after positioning the camera 408at a desired location. Additionally, in some implementations, therobotic arm 402 controls other features/functions of the camera 408,such as zoom (e.g., the robotic arm 402 adjusts a focal length of thecamera 408) and video based features/functions.

In some implementations, the robotic arm 402 positions the camera 408substantially adjacent to a surface (or feature) of the product 412.Additionally, in some implementations, the robotic arm 402 positions thecamera 408 so that the camera 408 is centered about the surface (or thefeature) of the product 412. To accomplish this, the robotic arm 402actuates (e.g., processor(s) 302 and/or positioning module 318) one ormore of the plurality of rotatable joints 406-A-406-C. In this way, thecamera 408 captures an image of the surface of the product 412, and therobotic arm 402 (or server system 200, FIG. 2) evaluates the image fordefects. The robotic arm 402 uses kinematic equations (e.g., forwardand/or inverse kinematics) when positioning the camera 408 at a desiredlocation. The kinematic equations are also referred to herein asmovement algorithms 332 (FIG. 3).

Moreover, in order to evaluate each surface and/or feature of theproduct 412, the production line 400 includes a rotatable base 410. Insome implementations, the robotic arm 402 (or a component thereof suchas the processor(s) 302 or rotatable base module 334, FIG. 3) controlsthe rotatable base 410. Alternatively, in some implementations, therotatable base is controlled by some other computing device, e.g., theserver system 200 (FIG. 2). Including the rotatable base 410 in theproduction line 400: (i) allows the robotic arm 402 to evaluate surfacesand/or features of the product 412 with minimal movement, and (ii)reduces a length of each of the plurality of segments 404-A-404-C. Forexample, the rotatable base 410 rotates the product 412 to present eachlateral surface of the product 412 to the camera 408. As such, therobotic arm 402 remains substantially stationary while each lateralsurface is placed in front of it (the robotic arm 402 need only reach atop surface of the product 412 as opposed to distant surfaces of theproduct 412, e.g., as shown in FIGS. 4B-4C).

In some implementations, when positioning the camera 408, the roboticarm 402 considers a field of view of the camera 408. For example,depending on a size of the product being captured, the robotic arm 402must place the camera 408 at a specific distance away from the product412 to capture an entire surface of the product 412. This specificdistance is dependent on the camera's field of view. An exemplary fieldof view may be a 60 degree field of view, but other fields of view arepossible (e.g., depending on lens type, focal length, camera type,etc.). The field of view (β) is represented in the working spaceequations below.

In some implementations, the robotic arm 402 identifies its workingspace by capturing an initial image of the product 412 (or by evaluatinga video feed taken by the camera). For example, in some circumstances,the product 412 is a smaller product, such as a tea kettle, whichrequires a first working space. However, in some other circumstances,the product 412 is a larger product, such as a refrigerator, whichrequires a second working space different from the first working space.In some implementations, a working space of the robotic arm 402 isrepresented by the following equation:

$l = {L + \frac{\max\left( {L,H} \right)}{2\;{\tan\left( \frac{\beta}{2} \right)}}}$$w = {W + \frac{\max\left( {L,H} \right)}{2\;{\tan\left( \frac{\beta}{2} \right)}}}$$h = {H + \frac{\max\left( {L,H} \right)}{2\;{\tan\left( \frac{\beta}{2} \right)}}}$where l, w, and h are the desired working spaces for the robotic arm 402(e.g., points that an end effector of the robotic arm 402 should reach);L, W, and H are a length, width, and height of the product 412,respectively; and β is the field of view of the camera 408. In someimplementations, the end effector of the robotic arm 402 is the camera408. Alternatively, in some implementations, the end effector of therobotic arm 402 is one of the plurality of rotatable joints (or multiplerotatable joints). It should be noted that the rotatable base 410 isfactored into the working space equation above. Additionally, workingspaces for various products may be stored in memory 306 (FIG. 3) of therobotic arm.

Because the robotic arm 402 is able to identify differences in sizesbetween products, and the robotic arm 402 is able to position itselfaccordingly to capture an initial image of the product 412 that issubstantially adjacent to and centered about a surface (or feature) ofthe product 412. In this way, the production line 400 can use a singlerobotic arm, as opposed to having multiple robotic arms that arecalibrated for certain products, thereby lowering an overall cost forthe production line 400.

FIG. 4B is an exemplary robotic arm 420 used to inspect a product 412,in accordance with some implementations. The robotic arm 420 is anexample of the robotic arm 300 (FIG. 3). One or more features shownand/or described above with reference to FIG. 4A are not described inFIG. 4B for the sake of brevity (or certain features have a shorteneddescription).

The robotic arm 420 includes a plurality of segments (or sections)424-A, 424-B, and 424-C. In some implementations, a length of each ofthe plurality of segments 424-A, 424-B, and 424-C is substantially thesame. Alternatively, in some implementations, a length of at least onesegment of the plurality of segments 424-A, 424-B, and 424-C differsfrom the other segments of the plurality of segments. Although therobotic arm 420 is shown to include three segments, it should beunderstood that the robotic arm 420 can include various numbers ofsegments (e.g., two segments, four segments, . . . N-segments).

The robotic arm 420 also includes a plurality of rotatable joints426-A-426-D. In some implementations, a number of joints included in theplurality of rotatable joints 426-A-426-D corresponds to a number ofsegments in the plurality of segments 424-A, 424-B, and 424-C (e.g., thenumber of joints will be one greater than the number of the plurality ofsegments). As shown, the first rotatable joint 426-A rotates about afirst axis of rotation (e.g., Y-axis), the second rotatable joint 426-Band the third rotatable joint 426-C rotate about a second axis ofrotation (e.g., Z-axis), and the fourth rotatable joint 426-D rotatesabout the first axis of rotation and the second axis of rotation.

As compared to the robotic arm 402 (FIG. 4A), lengths of the pluralitysegments 424-A-424-C of the robotic arm 420 are substantially greaterthan lengths of the plurality segments 404-A-404-C of the robotic arm402. This is because the product 412 is placed on top of a stationarybase 430, and therefore, the robotic arm 420 is required to reach eachsurface of the product 412. As a result of not having the rotatable base410, the fourth rotatable joint 426-D rotates about the first axis ofrotation and the second axis of rotation.

The robotic arm 420 also includes a camera 428 (e.g., capture device312, FIG. 3) attached to an end of the robotic arm 420. The robotic arm420 uses the procedures discussed above with reference to FIG. 4A toposition the camera 428 substantially adjacent to and centered about asurface (or feature) of the product 412.

In some implementations, the robotic arm 420 identifies its workingspace by capturing an initial image of the product 412 (or by evaluatinga video feed taken by the camera 428). In some implementations, aworking space of the robotic arm 420 is represented by the followingequation:

$l = {L + \frac{\max\left( {L,H} \right)}{\tan\left( \frac{\beta}{2} \right)}}$$w = {W + \frac{\max\left( {L,H} \right)}{\tan\left( \frac{\beta}{2} \right)}}$$h = {H + \frac{\max\left( {L,H} \right)}{2\;{\tan\left( \frac{\beta}{2} \right)}}}$where l, w, and h are the desired working spaces for the robotic arm 420(e.g., points that an end effector of the robotic arm 420 should reach);L, W, and H are a length, width, and height of the product 412,respectively; and β is the field of view of the camera 428. It should benoted that the rotatable base 410 is not part of the working spaceequation above.

FIG. 4C is an exemplary robotic arm 440 used to inspect a product 412,in accordance with some implementations. The robotic arm 440 is anexample of the robotic arm 300 (FIG. 3). One or more features describedabove with reference to FIG. 4A are not described in FIG. 4C for thesake of brevity (or certain features have a shortened description).

The robotic arm 440 includes a plurality of segments (or sections)444-A, 444-B, and 444-C. In some implementations, a length of each ofthe plurality of segments 444-A, 444-B, and 444-C is substantially thesame. Alternatively, in some implementations, a length of at least oneof the plurality of segments 444-A, 444-B, and 444-C differs from theother segments of the plurality of segments. Although the robotic arm440 is shown to include three segments, it should be understood that therobotic arm 440 can include various numbers of segments (e.g., twosegments, four segments, . . . N-segments).

The robotic arm 440 also includes a plurality of rotatable joints446-A-446-D. In some implementations, a number of joints included in theplurality of rotatable joints 446-A-446-D corresponds to a number ofsegments in the plurality of segments 444-A, 444-B, and 444-C (e.g., thenumber of joints will be one greater than the number of the plurality ofsegments). As shown, the first rotatable joint 446-A rotates about afirst axis of rotation (e.g., X-axis), the second rotatable joint 446-Band the third rotatable joint 446-C rotate about a second axis ofrotation (e.g., Z-axis), and the fourth rotatable joint 446-D rotatesabout one or more of the second axis of rotation and a third axis ofrotation (e.g., Y-axis).

The robotic arm 440 also includes a camera 448 (e.g., capture device312, FIG. 3) attached to an end of the robotic arm. The robotic arm 440uses the procedures discussed above with reference to FIG. 4A toposition the camera 448 substantially adjacent to and centered about asurface (or feature) of the product 412.

As compared to the robotic arm 402 (FIG. 4A), lengths of the pluralitysegments 444-A-444-C of the robotic arm 440 are substantially greaterthan lengths of the plurality segments 404-A-404-C of the robotic arm402. This is because the product 412 is placed on top of a stationarybase 450, and therefore, the robotic arm 440 is required to reach eachsurface of the product 412. However, when compared to the robotic arm420 (FIG. 4B), the robotic arm 440 is able to capture the five exposedsurface of the product 412 with fewer joint actuations than the roboticarm 420. This is accomplished due to the unique joint arrangement of therobotic arm 440 (e.g., the first rotatable joint 446-A rotates about theX-axis, and therefore three surfaces of the product 412 can be capturedby actuating the first rotatable joint 446-A).

In some implementations, the robotic arm 440 identifies its workingspace by capturing an initial image of the product 412 (or by evaluatinga video feed taken by the camera 448). In some implementations, aworking space of the robotic arm 440 is represented by the followingequation:

$l = {L + {4\;\cos\;{\theta\Delta}} - \frac{L\sqrt{L^{2} + H^{2}}}{2\sqrt{L^{2} + W^{2}}}}$$w = {W + {4\;\cos\;{\theta\Delta}} - \frac{W\sqrt{L^{2} + H^{2}}}{2\sqrt{L^{2} + W^{2}}}}$h = H + 2 sin  θ Δwhere,

$\theta = {\beta - {\cos^{- 1}\sqrt{\frac{2\left( {L^{2} + W^{2}} \right)}{L^{2} + W^{2} + {4H^{2}}}}}}$$\Delta = \sqrt{\left( \frac{L^{2} + H^{2}}{4} \right) + H^{2}}$and where l, w, and h are the desired working spaces for the robotic arm440 (e.g., points that an end effector of the robotic arm 440 shouldreach); L, W, and H are a length, width, and height of the product 412,respectively; and β is the field of view of the camera 448. It should benoted that the rotatable base 410 is not part of the working spaceequation above.

FIGS. 5A-5B show a robotic arm 402 capturing a first image 500 of aproduct 412, and a result of the capturing, in accordance with someimplementations.

As discussed above with reference to FIGS. 4A-4C, the robotic arm 402(or a component thereof such as the processor(s) 302 or a positioningmodule 318, FIG. 3) positions the camera 408 so that the camera 408 issubstantially adjacent to and centered about a surface (or feature) ofthe product 412. In some implementations, the robotic arm 402accomplishes this by first identifying the product 412 to be captured(e.g., microwave oven versus refrigerator), and based on the identifiedproduct, the robotic arm 402 determines its working space, which factorsin a field of view of the camera 408. Additionally, the robotic arm 402executes one or more kinematic equations to position itself. In doingso, the robotic arm 402 positions the camera 408 at a sufficientdistance away from the surface of the product 412 so that the camera 408captures an acceptable image (e.g., an image that includes the entiresurface, or an entire feature). This arrangement is illustrated in FIG.5A.

FIG. 5B shows a first image 500 captured by the camera 408. The firstimage 500 includes the surface 501 of the product 412 captured by thecamera 408, and a defect 502 on the surface 501.

In some implementations, the robotic arm 402 (or a component thereofsuch as the processor(s) 302 or an image inspection module 324, FIG. 3)identifies the defect 502 by processing (e.g., analyzing, evaluating,etc.) the first image 500. In some implementations, processing the firstimage 500 involves comparing portions (e.g., pieces) of the first image500 with one or more defect models (e.g., defect model(s) 328, FIG. 3).To accomplish this, the robotic arm 402 divides the first image 500 intopieces 504-1-504-N (e.g., forms a grid, where each piece of the grid hasan equal size) and compares at least a subset of the pieces 504-1-504-Nwith one or more defect models (e.g., defect model 600, FIG. 6A). Asshown in FIG. 6A, the defect model 600 includes defect pixels602-A-602-N. It should be noted that in some implementations, a “defectpixel” is a 1×1 pixel, while in some other implementations, a defectpixel includes multiple pixels (e.g., a 25×25 pixel, a 100×100 pixel, orsome greater or lesser number of pixels).

In some implementations, the defect pixels corresponds to the pieces ofthe first image 500 (e.g., a top left corner of defect model 600includes defect pixels that correspond to a top left corner of the firstimage 500). As such, the robotic arm 402 compares a first piece 504-1 ofthe first image 500 with one or more corresponding defect pixels from adefect model for the surface 501 of the product 412 (e.g., defect pixel602-A, FIG. 6A). In some implementations, the robotic arm 402 flips theone or more corresponding defect pixels left to right and/or top tobottom, during the comparison. Moreover, in some implementations, therobotic arm 402 rotates the one or more corresponding defect pixels 90degrees, 180 degrees, and/or 270 degrees during the comparison. In thisway, the robotic arm 402 evaluates possible variations of the one ormore corresponding defect pixels. It should be noted that “flipping” adefect pixel is not the same as “rotating” a defect pixel (e.g.,flipping a defect pixel causes features in the defect pixel to bemirrored in the resulting defect pixel).

In some implementations, the robotic arm 402 compares pieces of thefirst image 500 with the defect pixels sequentially. For example, piece504-1 is compared with one or more first corresponding defect pixels,piece 504-2 is compared with one or more second corresponding defectpixels, and so on. Alternatively, the robotic arm 402 compares pieces ofthe first image 500 with the defect pixels randomly, or pseudo-randomly.In some implementations, the robotic arm 402 performs an initialanalysis of the first image 500 to identify any abnormalities in thefirst image 500. If an abnormality is found, e.g., a bottom right cornerof the first image 500 differs from a control surface (discussed below),then the robotic arm 402 compares one or more pieces in the bottom rightcorner of the first image 500 with one or more corresponding defectpixels. In this way, the robotic arm 402 skips processing other portionsof the first image 500 that do not include abnormalities, thus savingtime and computing resources.

In some implementations, a defect pixel is a previously identifieddefect. For example, the previously identified defect may be identifiedduring a testing/calibration phase and/or during previous inspections(e.g., if the product 412 is a microwave oven, defects on surfaces ofpreviously inspected microwave ovens are logged and stored).Alternatively or in addition, in some implementations, a defect pixel isa desired result for each piece of the surface 501 of the product 412(i.e., a non-defect pixel). For example, during a testing/calibrationphase, an image of a control surface of a control product is captured,and each piece of the control surface is logged and stored (the controlsurface corresponding to the surface 501). Moreover, this process may berepeated for several control products to form the defect models 328(FIG. 3). In this way, the defect models 328 include a desired resultwith acceptable tolerances (e.g., a threshold difference from thecontrol surface that is required for an abnormality to be deemed adefect).

As shown in FIG. 5B, the first image 500 includes a defect 502 in piece504-5. Accordingly, in response to identifying the defect 502, therobotic arm repositions instead to capture a second image 530 of thesurface 501 of the product 512, as shown in FIGS. 5C-5D. It should benoted that a defect may span several pieces, depending on a size of thedefect. For ease of discussion and illustration, the defect 502 iscontained within a single piece 504-1. Additionally, in someimplementations, the server system 200 (FIG. 2), processes the firstimage 500 instead of the robotic arm 402 (e.g., the robotic arm 402sends the first image 500 to the server system 200 for evaluation).Moreover, in some implementations, the robotic arm 402 sends the firstimage 500 to the server system 200 for evaluation after identifying anabnormality in the first image 500.

FIGS. 5C-5D show the robotic arm capturing a second image 530 of theproduct and a result of the capturing, in accordance with someimplementations.

In response to identifying the defect 502 in the first image 500, therobotic arm 402 moves (e.g., repositions) itself from a first position520-A (dotted lines) to a second position 520-B. The robotic arm 402 inFIG. 5A is positioned at the first position 520-A, and therefore, therobotic arm 402 captures the first image 500 when positioned at thefirst position 520-A. In some implementations, movement between thefirst position 520-A and the second position 520-B is determined inaccordance with the first position 520-A of the camera 408 (or one ofthe rotatable joints) and a relative location of the defect 502 in thefirst image 500. In addition, the second position 520-B is within theworking space determined by the robotic arm 402, and the movementbetween the first position 520-A and the second position 520-B isdetermined in accordance with the working space. However, it should benoted that the goal of the robotic arm 402 repositioning itself is tofocus the camera 408 of the defect 502 (as opposed to capturing thesurface 501 in its entirety).

In some implementations, in response to identifying the defect 502 inthe first image 500, the robotic arm 402 (or a component thereof such asthe processor(s) 302 or a rotatable base module 334, FIG. 3) rotates therotatable base 410. The rotatable base 410 in FIG. 5A is positioned at afirst position (showing the product 412-A in a first position (dottedlines)), and therefore, the robotic arm 402 captures the first image 500when the product 412-A is in the first position. In someimplementations, the robotic arm 402 rotates the rotatable base 410 to asecond position in accordance with a relative location of the defect 502in the first image 500 (showing the product 412-B in a second position).

In some circumstances, when the robotic arm 402 repositions itself, itmoves the camera 408 in multiple directions. For example, the roboticarm 402 moves the camera 408 along the Y-axis, X-axis, and Z-axis. Therobotic arm 402 may move the camera 408 in multiple directions when thedefect 502 is offset from the center of the first image 500 (e.g., thedefect 502 in the first image 500 is offset towards an upper left cornerof the surface 501). However, in some instances, when the defect 502 isnot offset vertically from the center of the first image 500, therobotic arm 502 may move the camera 408 in a single direction (e.g.,along the X-axis towards the surface 501 of the product 412-B). Theminimal movement of the camera 408 is achieved because the rotatablebase 410 repositions the defect 502 in front of the camera. Of course,if the camera 408 is no longer adjacent to the surface 501 of theproduct 412-B as a result of the rotation of the rotatable base 410,then the robotic arm 402 may need to take further repositioning actions.

In some implementations, the robotic arm 402 uses kinematic equations(e.g., movement algorithms 332, FIG. 3) when moving from the firstposition 520-A to the second position 520-B. The kinematic equations mayinclude forward kinematic equations and/or inverse kinematic equations.Forward kinematics refers to the use of the kinematic equations of arobot to compute the position of the end-effector (e.g., a camera) fromspecified values for the joint parameters. In some implementations,exemplary forward kinematic equations are represented by the followingequations:

θ d a α Joint 1 θ₁ 0 a1 90° Joint 2 θ₂ 0 a2 0 Joint 3 θ₃ 0 a3 0 Joint 4θ₄ 0 a4 90°where θ, d, a, and α are the Denavit-Hartenberg parameters, as known bythose skilled in the art. For the robotic arm 402 shown in FIG. 4A, thefollowing forward kinematic matrices apply:

$A_{1} = \begin{bmatrix}{\cos\;\theta_{1}} & 0 & {\sin\;\theta_{1}} & {\alpha_{2}\cos\;\theta_{1}} \\{\sin\;\theta_{1}} & 0 & {{- \cos}\;\theta_{1}} & {\alpha_{2}\sin\;\theta_{1}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{2} = \begin{bmatrix}{\cos\;\theta_{2}} & {{- \sin}\;\theta_{2}} & 0 & {\alpha_{2}\cos\;\theta_{2}} \\{\sin\;\theta_{2}} & {\cos\;\theta_{2}} & 0 & {\alpha_{2}\sin\;\theta_{2}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{3} = \begin{bmatrix}{\cos\;\theta_{3}} & {{- \sin}\;\theta_{3}} & 0 & {\alpha_{3}\cos\;\theta_{3}} \\{\sin\;\theta_{3}} & {\cos\;\theta_{3}} & 0 & {\alpha_{3}\sin\;\theta_{3}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{4} = \begin{bmatrix}{\cos\;\theta_{4}} & 0 & {\sin\;\theta_{4}} & {\alpha_{4}\cos\;\theta_{4}} \\{\sin\;\theta_{4}} & 0 & {{- \cos}\;\theta_{4}} & {\alpha_{4}\sin\;\theta_{4}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{1234} = {{A_{1}A_{2}A_{3}A_{4}} = \begin{bmatrix}{C_{1}C_{234}} & S_{1} & {C_{1}C_{234}} & {{C_{1}C_{23}a_{3}} + {C_{1}C_{2}a_{2}} + {C_{1}a_{1}}} \\{S_{1}C_{234}} & {- C_{1}} & {S_{1}C_{234}} & {{S_{1}C_{23}a_{3}} + {S_{1}C_{2}a_{2}} + {S_{1}a_{1}}} \\{S_{234}C_{5}} & {- C_{234}} & {S_{234}S_{5}} & {{S_{23}a_{3}} + {S_{1}C_{1}a_{2}}} \\0 & 0 & 0 & 1\end{bmatrix}}$where “C”=cosine and “S”=sine.

Using the exemplary forward kinematic equations and matrices, therobotic arm 402 determines a position of an end effector (e.g., aposition of the camera 408, and/or one of the rotatable joints) in aworking space defined by the working space equations above.

In robotics, inverse kinematics makes use of the kinematics equations todetermine the joint parameters that provide a desired position for eachof a robot's end-effectors. Inverse kinematics transforms anend-effector's motion plan from a first position to a second positioninto joint actuator trajectories for the robot. In some implementations,exemplary inverse kinematic equations are represented by the followingequations:

$A_{1} = \begin{bmatrix}n_{x} & o_{x} & a_{x} & p_{x} \\n_{y} & o_{y} & a_{y} & p_{y} \\n_{z} & o_{z} & a_{z} & p_{z} \\0 & 0 & 0 & 1\end{bmatrix}$ $\theta_{1} = {{atan}\left( \frac{p_{x}}{p_{y}} \right)}$θ₂₃₄ = atan(a_(z), C₁a_(x) + S₁a_(y)) $\left\{ {\begin{matrix}{\theta_{2} = {{atan}\left( {S_{3},C_{3}} \right)}} \\{C_{3} = \frac{\left( {{C_{1}p_{x}} + {S_{1}p_{y}} - a_{1}} \right)^{2} + p_{z}^{2} - a_{2}^{2} - a_{3}^{2}}{2a_{2}a_{3}}} \\{S_{3} = {\pm \sqrt{1 - C_{3}^{2}}}}\end{matrix}\left\{ {{\begin{matrix}{\theta_{3} = {{atan}\left( {S_{2},C_{2}} \right)}} \\{S_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)p_{z}} - {S_{3}a_{3}A}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{C_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)A} - {S_{3}a_{3}p_{z}}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{A = {{p_{x}C_{1}} + {p_{y}S_{1}} - a_{1}}}\end{matrix}\theta_{4}} = {\theta_{234} - \theta_{2} - \theta_{3}}} \right.} \right.$where n, o, a, and p correspond to the four joints' spatial positions inthe Cartesian coordinate system.

In some implementations, the robotic arm 402 uses the inverse kinematicequations presented above to define its searching route (i.e., defininga path of the camera 408 (or one or more of the rotatable joints) fromthe first position 520-A to the second position 520-B. In someimplementations, exemplary searching route equations are represented bythe following equations for each joint of the robotic arm 402 (followingequations are based on cubic interpolation):

θ(t) = a₀ + a₁t + a₂t² + a₃t³${\overset{.}{\theta}(t)} = {a_{1} + {2a_{2}t} + {3a_{3}t^{2}}}$${\overset{¨}{\theta}(t)} = {{2a_{2}} + {6a_{3}t}}$ θ₀ = a₀θ_(f) = a₀ + a₁t_(f) + a₂t_(f)² + a₃t_(f)³${\overset{.}{\theta}}_{0} = a_{1}$${\overset{.}{\theta}}_{f} = {a_{0} + {a_{1}t_{f}} + {a_{2}t_{f}^{2}} + {a_{3}t_{f}^{3}}}$a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$In our case, {dot over (θ)}₀=0, {dot over (θ)}_(f)=0, so

a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = {\frac{3\left( {\theta_{f} - \theta_{0}} \right)}{t_{f}^{3}} = {\frac{3}{t_{f}^{2}}\Delta\;\theta}}$$a_{2} = {{- \frac{2\left( {\theta_{f} - \theta_{0}} \right)}{t_{f}^{3}}} = {{- \frac{2}{t_{f}^{2}}}\Delta\;\theta}}$where (θ_(f)−θ₀)=Δθ, “a” and “t” are acceleration and time,respectively.

It should be noted that the equations above a merely one example ofequations that can be used to control movement of the robotic arm 402.Those skilled in the art will appreciate that various other equationscan be used to control movement of the robotic arm 402. Additionally, insome implementations, different equations can be used to control roboticarms 420 and 440. These equations are provided below (after thediscussion of method 700).

FIGS. 6A-6B show a defect model (defect table) 600 and a defect 502being added to the defect table 600, in accordance with someimplementations. As noted above, the defect model 600 (e.g., defectmodel(s) 328, FIG. 3) includes defect pixels 602-A-602-N. In someimplementations, a position of a defect pixel 602 in the defect model600 corresponds to a piece (or multiple pieces) of an image beinginspected (e.g., a top left corner of the defect model 600 includespixels that correspond to a top left corner of the first image 500, FIG.5B). Alternatively, in some implementations, a first defect modelcorresponds to a first piece or a first portion of the image beinginspected, a second defect model corresponds to a second piece or asecond portion of the image being inspected, and so on.

In some implementations, the defect pixels 602-A-602-N in the defectmodel 600 are previously identified defects. For example, a previouslyidentified defect may be identified during a testing/calibration phaseand/or during previous inspections (e.g., if the product 412 is amicrowave oven, defects on surfaces of previously inspected microwaveovens are logged and stored in the defect model 600). Alternatively orin addition, in some implementations, a defect pixel 602 is a desiredresult for a piece of the product being inspected (i.e., a non-defectpixel). For example, during a testing/calibration phase, an image of acontrol surface of a control product is captured, and each piece of thecontrol surface is logged and stored in the defect model 600. Moreover,this process may be repeated for several control products to form thedefect model 600.

In some implementations, the defect 502 (FIG. 5B) is added to the defectmodel 600 after the robotic arm captures the second image 530. Forexample, the defect model 600 includes new defect pixel 604, whichincludes the defect 502. In this way, the robotic arm 402 implementsmachine learning to continually update the defect model 600. As such,the defect 502 may be referenced to identify defects on a subsequentproduct inspected by the robotic arm 402.

FIG. 7 is a flow diagram illustrating a method 700 of improved qualityinspection on a product, in accordance with some implementations. Thesteps of the method 700 may be performed by a robotic arm (e.g., edgedevice 102, FIG. 1; robotic arm 300, FIG. 3). FIG. 7 corresponds toinstructions stored in a computer memory or computer readable storagemedium (e.g., memory 306 of the robotic arm 300). For example, theoperations of the method 700 are performed, at least in part, by acommunications module (e.g., communications module 316, FIG. 3), apositioning module (e.g., positioning module 318, FIG. 3), a capturemodule (e.g., capture module 320, FIG. 3), and an image inspectionmodule (e.g., image inspection module 324, FIG. 3).

The robotic arm includes a plurality of segments (e.g., segments 404-A,404-B, and 404-C, FIG. 4A), a camera at an end of the robotic arm (e.g.,camera 408 at end of robotic arm 402, FIG. 4A), and a plurality ofrotatable joints (e.g., rotatable joints 406-A-406-D, FIG. 4A), eachrotatable joint connecting two segments of the plurality of segments orthe camera with one segment of the plurality of segments (702). In someimplementations, the plurality of rotatable joints provides the roboticarm with four degrees of freedom. Alternatively, in someimplementations, the plurality of rotatable joints provides the roboticarm with five degrees of freedom. In some implementations, a first setof rotatable joints in the plurality of rotatable joints rotate about afirst axis (e.g., Z-axis) and a second set of rotatable joints in theplurality of rotatable joints rotate about a second axis (e.g., Y-axis),or vice versa. In some implementations, the first set of rotatablejoints is body rotatable joints (e.g., rotatable joints 406-B and 406-C,FIG. 4A) and the second set of rotatable joints is end rotatable joints(e.g., rotatable joints 406-A and 406-D, FIG. 4A). In someimplementations, at least one of the rotatable joints rotates about twoaxes (e.g., rotatable joint 406-D, in some implementations, rotatesabout the Z-axis and the Y-axis, or some other combination of axes).

The method 700 includes receiving (704) a command to capture a firstimage of a surface (or a feature) of a product (e.g., product 412, FIG.4A). In some implementations, the robotic arm receives the command fromthe server system, or some other computer (e.g., a control computer ofthe production line 400, FIG. 4A). As an alternative to receiving thecommand, in some implementations, the robotic arm recognizes the productplaced in front of it. For example, the robotic arm may determine a sizeof the product from a video feed of the camera, and the size of theproduct may correspond to a product type (e.g., a product having a firstsize is a tea kettle and a product having a second size is a microwaveoven). In response to recognizing the product, the robotic arm capturesthe first image of the surface of the product (discussed below).Accordingly, in these implementations, receiving the command isoptional.

In some implementations, the robotic arm captures an initial image(different from the first image) of the product. Using the initialimage, the robotic arm determines a working space for an end effector ofthe robotic arm. The working space may extend from each surface (orfeature) of the product to a specific distance away from each surface(or feature) of the product. In some implementations, the end effectorof the robotic arm is the camera. Alternatively or in addition, the endeffector of the robotic arm is one or more of the plurality of rotatablejoints. In some implementations, the working space of the end effectoris determined based on a shape/size of the product (e.g., height, width,length, and volume of the product). Alternatively or in addition, insome implementations, the working space of the end effector isdetermined based on the camera's field of view. Determining the workingspace of the robotic arm is discussed in further detail above withreference to FIG. 4A.

In some implementations, in response to receiving the command (or inresponse to recognizing the product), the method 700 further includespositioning (706), by actuating the plurality of rotatable joints, thecamera at a first position that is substantially adjacent to the surfaceof the product. In some implementations, the camera is centered aboutthe surface of the product when at the first position. In someimplementations, the camera is adjacent to a predetermined portion ofthe surface when at the first position (e.g., a defect prone portion ofthe surface). In some implementations, the first position is within theworking space determined by the robotic arm, and the camera is the endeffector of the robotic arm.

In some instances, the robotic arm positions itself in a defaultposition after examining a previous product. The default position is aretracted position, which assures an incoming product does not damagethe camera (e.g., avoid a collision between camera and the incomingproduct). This is especially important when a previously examinedproduct is substantially smaller than the incoming product. As such,when retracted to the default position, positioning the camera at thefirst position (706) involves moving the robotic arm from the defaultposition to the first position. The robotic arm may use the movementalgorithms 332 to move the camera from the default position to the firstposition.

It should be noted that in some instances the camera is already at thefirst position, and therefore, the operation 706 may be optional,depending on the circumstances. For example, a previously examinedproduct, such as a microwave oven, may pass inspection, and a subsequentproduct, which is the same model microwave oven, may then be examined,thereby not requiring movement of the camera.

In some implementations, the camera is separated from the surface by afirst distance when positioned at the first position. The first distancecorresponding to the working space determined by the robotic arm.Moreover, in some implementations, the camera is set at a first focallength when positioned at the first position (e.g., set to a firstzoom). In some implementations, the field of view of the camera isbased, at least in part, on a focal length of the camera. Accordingly,in some implementations, the robotic arm adjusts a focal length of thecamera when determining the working space (e.g., zooms in or out,depending on the circumstances).

The method 700 further includes capturing (708), via the camera, thefirst image of the surface of the product with the camera positioned atthe first position (e.g., the first position 520-A, FIG. 5C). Forexample, with reference to FIG. 5B, the first image 500 includes asurface 501 of the product 412.

The method 700 further includes, after capturing the first image,processing (710) the first image to identify a defect in the first imageand a relative location of the defect in the first image. In someimplementations, processing the first image includes comparing pieces ofthe first image with one or more defect models (e.g., one or more defectmodels 328, FIG. 3). To accomplish this, the robotic arm divides thefirst image into pieces (e.g., pieces 504-1-504-N, FIG. 5B) and comparesat least a subset of the pieces with one or more defect models. As shownin FIG. 6A, the defect model 600 includes defect pixels 602-A-602-N. Insome implementations, a defect pixel is a 1×1 pixel. Alternatively, insome implementations, a defect pixel includes multiple pixels (e.g., a25×25 pixel, a 100×100 pixel, or some greater or lesser number ofpixels). Processing an image is discussed in further detail above withreference to FIG. 5B.

In some implementations, processing the first image also includesperforming an initial analysis of the first image to identify anyabnormalities in the first image. The initial analysis may includecomparing regions of the first image with a template (i.e., control) ofthe surface of the product (e.g., less demanding analysis than thecomparing operation discussed above). The template of the surfaceincludes a desired result of the surface (e.g., a previously examinedsurface of the product that passed quality control). If an abnormalityis found, e.g., a bottom right corner of the first image differs fromthe template, then the robotic arm compares one or more pieces in thebottom right corner of the first image with one or more correspondingdefect pixels (as discussed above). In this way, the robotic arm skipsprocessing other pieces of the first image that do not includeabnormalities, thus saving time and computing resources. For ease ofdiscussion, an abnormality as used herein is not necessarily a defect,but is instead a deviation from a control/template. However, anabnormality can be transformed into a defect with further investigation.

In some implementations, the method 700 further includes determining(712) whether the first image includes a defect based on the processing(i.e., based on comparing the pieces of the first image with one or moredefect models). In some implementations, the robotic arm determines thatthe first image includes a defect when a piece (or a threshold number ofpieces) of the first image either: (1) matches (or partially matches) adefect pixel in the defect model, or (2) does not match (or partiallymatch) any non-defect pixels in the defect model. In someimplementations, a partially match is deemed sufficient when a thresholdpercentage of the defect matches the defect pixel. As discussed above,the defect model, in some implementations, includes “non-defect pixels,”which are desired results for pieces of the product (e.g., pieces of theproduct that previously passed quality control, and were logged in adefect model 328, FIG. 3). Determining that an image includes a defectis discussed in further detail above with reference to FIG. 5B.

In some implementations, the robotic arm creates a local binary pattern(LBP) to determine whether the first image includes a defect. To createthe LBP, a value is assigned to a piece based on the processing (710).For example, a first value is assigned to the piece when the piecedirectly matches a defect pixel (e.g., a 90% match) and a second value,less than the first value, is assigned to the piece when the piecepartially matches a defect pixel (e.g., 60% match) (values may alsoassigned using non-defect pixels). Moreover, the value of the piece iscompared to values of neighboring pieces (e.g., any given piece haseight neighboring pieces). Continuing, if the value of the piece isgreater than a neighboring piece's value, then the piece is assigned a“1,” and if the value of the piece is less than a neighboring piece'svalue, then the piece is assigned a “0.” After the comparing, a totalmetric is assigned to the piece. In some implementations, the metric isan eight digit binary number with each digit corresponding to one of theeight comparisons. The process described above is repeated for multiplepieces (or each piece) in the first image, and a chart (e.g., ahistogram) is created to illustrate the results. The chart includes afrequency of each binary number occurring. A region (e.g., a firstlocation) of the histogram having a first binary number (or an averagefirst binary number) may indicate that that region includes a defect anda different region (e.g., a second location) of the histogram having asecond binary number (or an average second binary number) may indicatethat that region does not include a defect. The histogram may be anN-number dimensional feature vector, and in some implementations, thehistogram is normalized. In such implementations, a feature vector isestablished for the first image.

In some implementations, a support vector machine (SVM) is also used todetermine that the first image includes a defect. The SVM is asupervised learning model in machine learning with associated learningalgorithms that analyze data used for classification and regressionanalysis. For example, given a set of training examples, each marked asbelonging to one or the other of two categories, an SVM trainingalgorithm builds a binary classifier that assigns new examples to onecategory or the other. An SVM model is a representation of the examplesas points in space, mapped so that the examples of the separatecategories are divided by a clear gap that is as wide as possible. Newexamples are then mapped into that same space and predicted to belong toa category based on which side of the gap they fall. In someimplementations, the SVM determines that the first image includes adefect using the LBP discussed above.

In response to determining that the first image does not include adefect (712—No), the method 700 further includes recording and reporting(714) the product as acceptable. Alternatively, in response todetermining that the first image includes a defect (712—Yes), the method700 further includes determining (716) a second position of the camerain accordance with the first position of the camera and the relativelocation of the defect in the first image. It should be noted that, whendetermining that the first image includes a defect, the robotic arm maybe determining that the first image likely has a defect. As such, as isdiscussed below, the robotic arm captures a second image of the surfaceto verify that the identified defect is actually a defect.

The method 700 further includes repositioning (718), by actuating theplurality of rotatable joints, the camera from the first position to thesecond position. The second position has a different spatialrelationship to the surface of the product than the first position. Forexample, the camera is separated from the surface by a second distancewhen repositioned at the second position, and the second distance isless than the first distance. Moreover, in some implementations, thecamera is set at a second focal length when repositioned at the secondposition, and the second focal length is greater than the first focallength (e.g., set to a second zoom). The goal of the robotic armrepositioning itself is to focus the camera of the defect (as opposed tocapturing the surface in its entirety). For example, as shown in FIG.5D, the defect is magnified in a center portion of the second image 530.In this way, the robotic arm can verify that the identified defect isactually a defect

The method 700 further includes capturing (720), via the camera, thesecond image of the surface of the product with the camera positioned atthe second position. In response to capturing the second image, in someimplementations, the robotic arm verifies that the identified defect isactually a defect. To verify the defect, the robotic arm again comparesthe defect with defect pixels (and/or non-defect pixels) in the defectmodel. This comparison operation, however, is more granular relative tothe first image's comparison operation. The robotic may determine thatthe defect corresponds to an already identified defect (e.g., a defectcaused by a tool). Alternatively, the robotic may determine that thedefect does not correspond to any already identified defect, but it isnevertheless a defect. In either case, the robotic arm may generate areport and provide the report to the appropriate party (e.g., aprocessing engineer responsible for a specific part of the manufacturingprocess). After verifying the defect, in some implementations, themethod 700 includes recording and reporting the product as unacceptable.

Moreover, in some implementations, the method 700 further includesupdating the defect model to include the defect. For example, withreference to FIG. 6B, new defect pixel 604, which includes the defect502, is added to the defect model 610. In some implementations, thedefect is added to the defect model after step 712—Yes. Alternatively,in some implementations, the defect is added to the defect model afterverifying the defect.

In some implementations, however, the robotic arm cannot verify thedefect. In such cases, the method 700 includes recording and reportingthe product as acceptable. In these circumstances, the robotic arm mayupdate the defect model to include the non-verified defect as being anacceptable abnormality (i.e., a non-defect pixel).

In some implementations, the product is positioned on a rotatable base(e.g., rotatable base 311, FIG. 3; rotatable base 410, FIG. 4A).Further, in some implementations, the method 700 includes rotating therotatable base in accordance with the relative location of the defect inthe first image after capturing the first image. The second image isthen captured after rotating the rotatable base. For example, therobotic arm (or a component thereof such as processors 302 or rotatablebase module 334, FIG. 3) controls the rotatable base and rotates therotatable base so that the defect is positioned in front of the camera.This configuration minimizes a degree of movement required by therobotic arm because the defect essentially comes to the camera insteadof the camera going to the defect. As such, time and resources areconserved when the rotatable base is included. Moreover, a length ofeach segment in the plurality of segments can be substantially reducedbecause the robotic arm does not have to reach distant lateral surfacesof the product. At most, the robotic arm is required to reach a topsurface of the product, assuming that the top surface needs inspecting.

In some implementations, prior to capturing the first image, the method700 further includes determining a size of the product, and based on thedetermined size, the robotic arm determines it working space. Forexample, the robotic arm, when positioned at the default position,detects the product in front of it, and determines the size of theproduct using an image captured by the camera and the camera's position.In some implementations, in order to determine the size of the product,the robotic arm captures an initial image of the product and determinesthe size of the product from the initial image and the position of thecamera capturing the initial image. Alternatively, in someimplementations, the robotic arm evaluates the product based on a videofeed from the camera.

In some implementations, the method 700 further includes repositioning,by actuating the plurality of rotatable joints, the camera at one ormore additional positions, where each additional position issubstantially adjacent to a respective additional surface (or anadditional feature) of the product. For example, with reference to FIGS.4B-4C, the robotic arms 420 and 440 reach distant lateral surfaces ofthe product 412. However, in those implementations involving therotatable base (e.g., FIG. 4A), the robotic arm can leverage therotatable base to rotate the product so that each respective additionalsurface of the product is positioned in front of the camera. Again, thisarrangement results in the additional surfaces coming to the camerainstead of the camera going to the defect. In this way, time andresources are conserved.

In some implementations, the method 700 further includes capturing, viathe camera, an additional image of each respective additional surface ofthe product with the camera positioned at the one or more additionalpositions. Each additional image is processed in the same manner asdiscussed above.

The following equations relate to the robotic arms 420 and 440,discussed above with reference to FIGS. 4B-4C.

In some implementations, the robotic arm 420 uses kinematic equations(e.g., movement algorithms 332, FIG. 3) when moving from one position toanother. The kinematic equations may include forward kinematic equationsand/or inverse kinematic equations. In some implementations, exemplaryforward kinematic equations are represented by the following equations:

θ d a α Joint 1 θ₁ 0 a₁ 90° Joint 2 θ₂ 0 a₂ 0 Joint 3 θ₃ 0 a₃ 0 Joint 4θ₄ 0 0 0 Joint 5 θ₅ 0 0 90°where θ, d, a, and a are the Denavit-Hartenberg parameters, as known bythose skilled in the art. For the robotic arm 420 shown in FIG. 4B, thefollowing forward kinematic matrices apply:

$A_{1} = \begin{bmatrix}{\cos\;\theta_{1}} & 0 & {\sin\;\theta_{1}} & {\alpha_{2}\cos\;\theta_{1}} \\{\sin\;\theta_{1}} & 0 & {{- \cos}\;\theta_{1}} & {\alpha_{2}\sin\;\theta_{1}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{2} = \begin{bmatrix}{\cos\;\theta_{2}} & {{- \sin}\;\theta_{2}} & 0 & {\alpha_{2}\cos\;\theta_{2}} \\{\sin\;\theta_{2}} & {\cos\;\theta_{2}} & 0 & {\alpha_{2}\sin\;\theta_{2}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{3} = \begin{bmatrix}{\cos\;\theta_{3}} & {{- \sin}\;\theta_{3}} & 0 & {\alpha_{3}\cos\;\theta_{3}} \\{\sin\;\theta_{3}} & {\cos\;\theta_{3}} & 0 & {\alpha_{3}\sin\;\theta_{3}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{4} = \begin{bmatrix}{\cos\;\theta_{4}} & 0 & {\sin\;\theta_{4}} & {\alpha_{4}\cos\;\theta_{4}} \\{\sin\;\theta_{4}} & 0 & {{- \cos}\;\theta_{4}} & {\alpha_{4}\sin\;\theta_{4}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{5} = \begin{bmatrix}{\cos\;\theta_{5}} & 0 & {\sin\;\theta_{5}} & {\alpha_{5}\cos\;\theta_{5}} \\{\sin\;\theta_{5}} & 0 & {{- \cos}\;\theta_{5}} & {\alpha_{5}\sin\;\theta_{5}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{12345} = {\quad\left\lbrack \begin{matrix}{C_{1}C_{234}C_{5}} & {C_{1}S_{234}} & {{C_{1}C_{234}S_{5}} - {S_{1}C_{5}}} & {{C_{1}C_{23}a_{3}} + {C_{1}C_{2}a_{2}} + {C_{1}a_{1}}} \\{S_{1}C_{234}C_{5}} & {S_{1}S_{234}} & {{S_{1}C_{234}S_{5}} + {C_{1}C_{5}}} & {{S_{1}C_{23}a_{3}} + {S_{1}C_{2}a_{2}} + {S_{1}a_{1}}} \\{S_{234}C_{5}} & {- C_{234}} & {S_{234}S_{5}} & {{S_{23}a_{3}} + {S_{1}C_{1}a_{2}}} \\0 & 0 & 0 & 1\end{matrix} \right\rbrack}$where “C”=cosine and “S”=sine.

In some implementations, exemplary inverse kinematic equations for therobotic arm 420 are represented by the following equations:

$= \begin{bmatrix}n_{x} & o_{x} & a_{x} & p_{x} \\n_{y} & o_{y} & a_{y} & p_{y} \\n_{z} & o_{z} & a_{z} & p_{z} \\0 & 0 & 0 & 1\end{bmatrix}$And

$\theta_{1} = {{atan}\left( \frac{p_{x}}{p_{y}} \right)}$θ₂₃₄ = atan(a_(z), C₁a_(x) + S₁a_(y)) $\left\{ {\begin{matrix}{\theta_{2} = {{atan}\left( {S_{3},C_{3}} \right)}} \\{C_{3} = \frac{\left( {{C_{1}p_{x}} + {S_{1}p_{y}} - a_{1}} \right)^{2} + p_{z}^{2} - a_{2}^{2} - a_{3}^{2}}{2a_{2}a_{3}}} \\{S_{3} = {\pm \sqrt{1 - C_{3}^{2}}}}\end{matrix}\left\{ {{\begin{matrix}{\theta_{3} = {{atan}\left( {S_{2},C_{2}} \right)}} \\{S_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)p_{z}} - {S_{3}a_{3}A}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{C_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)A} - {S_{3}a_{3}p_{z}}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{A = {{p_{x}C_{1}} + {p_{y}S_{1}} - a_{1}}}\end{matrix}\theta_{4}} = {\theta_{234} - \theta_{2} - {\theta_{3}\left\{ \begin{matrix}{\theta_{5} = {{atan}\left( {S_{5},C_{5}} \right)}} \\{S_{5} = {{C_{1}C_{234}a_{x}} + {S_{1}C_{234}a_{y}} + {S_{234}a_{z}}}} \\{C_{2} = {{C_{1}a_{y}} + {s_{1}a_{x}}}}\end{matrix} \right.}}} \right.} \right.$

In some implementations, the robotic arm 420 uses the inverse kinematicequations presented above to define its searching route (i.e., defininga path of the camera 428 (or one or more of the rotatable joints) from afirst position to a second position). In some implementations, exemplarysearching route equations are represented by the following equations(following equations are based on cubic interpolation):

θ(t) = a₀ + a₁t + a₂t² + a₃t³${\overset{.}{\theta}(t)} = {a_{1} + {2a_{2}t} + {3a_{3}t^{2}}}$${\overset{¨}{\theta}(t)} = {{2a_{2}} + {6a_{3}t}}$ θ₀ = a₀θ_(f) = a₀ + a₁t_(f) + a₂t_(f)² + a₃t_(f)³${\overset{.}{\theta}}_{0} = a_{1}$${\overset{.}{\theta}}_{f} = {a_{0} + {a_{1}t_{f}} + {a_{2}t_{f}^{2}} + {a_{3}t_{f}^{3}}}$a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$In our case,

a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$

In some implementations, the robotic arm 440 uses kinematic equations(e.g., movement algorithms 332, FIG. 3) when moving from one position toanother. The kinematic equations may include forward kinematic equationsand/or inverse kinematic equations. In some implementations, exemplaryforward kinematic equations are represented by the following equations:

θ d a α Joint 1 θ₁ 0 a₁ 90° Joint 2 θ₂ 0 a₂ 0 Joint 3 θ₃ 0 a₃ 0 Joint 4θ₄ 0 0 90°where θ, d, a, and a are the Denavit-Hartenberg parameters, as known bythose skilled in the art. For the robotic arm 440 shown in FIG. 4C, thefollowing forward kinematic matrices apply:

$A_{1} = \begin{bmatrix}{\cos\;\theta_{1}} & 0 & {\sin\;\theta_{1}} & {\alpha_{2}\cos\;\theta_{1}} \\{\sin\;\theta_{1}} & 0 & {{- \cos}\;\theta_{1}} & {\alpha_{2}\sin\;\theta_{1}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{2} = \begin{bmatrix}{\cos\;\theta_{2}} & {{- \sin}\;\theta_{2}} & 0 & {\alpha_{2}\cos\;\theta_{2}} \\{\sin\;\theta_{2}} & {\cos\;\theta_{2}} & 0 & {\alpha_{2}\sin\;\theta_{2}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{3} = \begin{bmatrix}{\cos\;\theta_{3}} & {{- \sin}\;\theta_{3}} & 0 & {\alpha_{3}\cos\;\theta_{3}} \\{\sin\;\theta_{3}} & {\cos\;\theta_{3}} & 0 & {\alpha_{3}\sin\;\theta_{3}} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{4} = \begin{bmatrix}{\cos\;\theta_{4}} & 0 & {\sin\;\theta_{4}} & {\alpha_{4}\cos\;\theta_{4}} \\{\sin\;\theta_{4}} & 0 & {{- \cos}\;\theta_{4}} & {\alpha_{4}\sin\;\theta_{4}} \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1\end{bmatrix}$ $A_{1234} = \begin{bmatrix}{C_{1}C_{234}} & S_{1} & {C_{1}C_{234}} & {{C_{1}C_{23}a_{3}} + {C_{1}C_{2}a_{2}} + {C_{1}a_{1}}} \\{S_{1}C_{234}} & {- C_{1}} & {S_{1}C_{234}} & {{S_{1}C_{23}a_{3}} + {S_{1}C_{2}a_{2}} + {S_{1}a_{1}}} \\{S_{234}C_{5}} & {- C_{234}} & {S_{234}S_{5}} & {{S_{23}a_{3}} + {S_{1}C_{1}a_{2}}} \\0 & 0 & 0 & 1\end{bmatrix}$where “C”=cosine and “S”=sine.

In some implementations, exemplary inverse kinematic equations for therobotic arm 440 are represented by the following equations:

$= \begin{bmatrix}n_{x} & o_{x} & a_{x} & p_{x} \\n_{y} & o_{y} & a_{y} & p_{y} \\n_{z} & o_{z} & a_{z} & p_{z} \\0 & 0 & 0 & 1\end{bmatrix}$And

$\theta_{1} = {{atan}\left( \frac{p_{x}}{p_{y}} \right)}$θ₂₃₄ = atan(a_(z), C₁a_(x) + S₁a_(y)) $\left\{ {\begin{matrix}{\theta_{2} = {{atan}\left( {S_{3},C_{3}} \right)}} \\{C_{3} = \frac{\left( {{C_{1}p_{x}} + {S_{1}p_{y}} - a_{1}} \right)^{2} + p_{z}^{2} - a_{2}^{2} - a_{3}^{2}}{2a_{2}a_{3}}} \\{S_{3} = {\pm \sqrt{1 - C_{3}^{2}}}}\end{matrix}\left\{ {{\begin{matrix}{\theta_{3} = {{atan}\left( {S_{2},C_{2}} \right)}} \\{S_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)p_{z}} - {S_{3}a_{3}A}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{C_{2} = \frac{{\left( {a_{2} + {C_{3}a_{3}}} \right)A} - {S_{3}a_{3}p_{z}}}{\left( {a_{2} + {C_{3}a_{3}}} \right)^{2} + {S_{3}^{2}a_{3}^{2}}}} \\{A = {{p_{x}C_{1}} + {p_{y}S_{1}} - a_{1}}}\end{matrix}\theta_{4}} = {\theta_{234} - \theta_{2} - \theta_{3}}} \right.} \right.$

In some implementations, the robotic arm 440 uses the inverse kinematicequations presented above to define its searching route (i.e., defininga path of the camera 448 (or one or more of the rotatable joints) from afirst position to a second position). In some implementations, exemplarysearching route equations are represented by the following equations(following equations are based on cubic interpolation):

θ(t) = a₀ + a₁t + a₂t² + a₃t³${\overset{.}{\theta}(t)} = {a_{1} + {2a_{2}t} + {3a_{3}t^{2}}}$${\overset{¨}{\theta}(t)} = {{2a_{2}} + {6a_{3}t}}$ θ₀ = a₀θ_(f) = a₀ + a₁t_(f) + a₂t_(f)² + a₃t_(f)³${\overset{.}{\theta}}_{0} = a_{1}$${\overset{.}{\theta}}_{f} = {a_{0} + {a_{1}t_{f}} + {a_{2}t_{f}^{2}} + {a_{3}t_{f}^{3}}}$a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$In our case,

a₀ = θ₀ $a_{1} = {\overset{.}{\theta}}_{0}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$$a_{2} = \frac{{3\left( {\theta_{f} - \theta_{0}} \right)} - \left( {{2{\overset{.}{\theta}}_{0}} + {\overset{.}{\theta}}_{f}} \right)}{t_{f}^{3}}$

Although some of various drawings illustrate a number of logical stagesin a particular order, stages which are not order dependent may bereordered and other stages may be combined or broken out. While somereordering or other groupings are specifically mentioned, others will beobvious to those of ordinary skill in the art, so the ordering andgroupings presented herein are not an exhaustive list of alternatives.Moreover, it should be recognized that the stages could be implementedin hardware, firmware, software or any combination thereof.

The foregoing description, for purpose of explanation, has beendescribed with reference to specific implementations. However, theillustrative discussions above are not intended to be exhaustive or tolimit the scope of the claims to the precise forms disclosed. Manymodifications and variations are possible in view of the aboveteachings. The implementations were chosen in order to best explain theprinciples underlying the claims and their practical applications, tothereby enable others skilled in the art to best use the implementationswith various modifications as are suited to the particular usescontemplated.

What is claimed is:
 1. A robotic arm comprising: a plurality ofsegments; a camera at an end of the robotic arm; a plurality ofrotatable joints, each rotatable joint connecting two segments of theplurality of segments or the camera with one segment of the plurality ofsegments; one or more processors; and memory storing one or moreprograms for execution by the one or more processors, the one or moreprograms including instructions for: receiving a command to capture afirst image of a surface of a product; positioning, by actuating theplurality of rotatable joints, the camera at a first position that issubstantially adjacent to the surface of the product; capturing, via thecamera, the first image of the surface of the product with the camerapositioned at the first position; and after capturing the first image:processing the first image to identify a defect in the first image and arelative location of the defect in the first image; determining a secondposition of the camera in accordance with the first position of thecamera and the relative location of the defect in the first image;repositioning, by actuating the plurality of rotatable joints, thecamera from the first position to the second position, wherein thesecond position has a different spatial relationship to the surface ofthe product than the first position; and capturing, via the camera, thesecond image of the surface of the product with the camera positioned atthe second position.
 2. The robotic arm of claim 1, wherein: the camerais separated from the surface by a first distance when positioned at thefirst position; the camera is separated from the surface by a seconddistance when repositioned at the second position; and the seconddistance is less than the first distance.
 3. The robotic arm of claim 1,wherein: the camera is set at a first focal length when positioned atthe first position; the camera is set at a second focal length whenrepositioned at the second position; and the second focal length isgreater than the first focal length.
 4. The robotic arm of claim 1,wherein the one or more programs further include instructions for:determining a size of the product from the first image of the surface ofthe product and the first position of the camera; and based on thedetermined size, assigning a working space for the robotic arm.
 5. Therobotic arm of claim 4, wherein positioning the camera at the firstposition and repositioning the camera from the first position to thesecond position is performed within the working space determined for therobotic arm.
 6. The robotic arm of claim 1, wherein the plurality ofrotatable joints provides the robotic arm with four degrees of freedom.7. The robotic arm of claim 1, wherein the plurality of rotatable jointsprovides the robotic arm with five degrees of freedom.
 8. The roboticarm of claim 1, wherein: a first set of rotatable joints in theplurality of rotatable joints rotate about a first axis; and a secondset of rotatable joints in the plurality of rotatable joints rotateabout a second axis.
 9. The robotic arm of claim 8, wherein: the firstset of rotatable joints is body rotatable joints; and the second set ofrotatable joints is end rotatable joints.
 10. The robotic arm of claim1, wherein the one or more programs further include instructions for:repositioning, by actuating the plurality of rotatable joints, thecamera at one or more additional positions, each additional position issubstantially adjacent to a respective additional surface of theproduct; and capturing, via the camera, an additional image of eachrespective additional surface of the product with the camera positionedat the one or more additional positions.
 11. The robotic arm of claim 1,wherein: the product is positioned on a rotatable base; the one or moreprograms further include instructions for, after capturing the firstimage, rotating the rotatable base in accordance with the relativelocation of the defect in the first image; and the second image iscaptured after rotating the rotatable base.
 12. A method of improvedquality inspection, comprising: at a robotic arm comprising a pluralityof segments, a camera at an end of the robotic arm, and a plurality ofrotatable joints, each rotatable joint connecting two segments of theplurality of segments or the camera with one segment of the plurality ofsegments: receiving a command to capture a first image of a surface of aproduct; positioning, by actuating the plurality of rotatable joints,the camera at a first position that is substantially adjacent to thesurface of the product; capturing, via the camera, the first image ofthe surface of the product with the camera positioned at the firstposition; and after capturing the first image: processing the firstimage to identify a defect in the first image and a relative location ofthe defect in the first image; determining a second position of thecamera in accordance with the first position of the camera and therelative location of the defect in the first image; repositioning, byactuating the plurality of rotatable joints, the camera from the firstposition to the second position, wherein the second position has adifferent spatial relationship to the surface of the product than thefirst position; and capturing, via the camera, the second image of thesurface of the product with the camera positioned at the secondposition.
 13. The method of claim 12, wherein: the camera is separatedfrom the surface by a first distance when positioned at the firstposition; the camera is separated from the surface by a second distancewhen repositioned at the second position; and the second distance isless than the first distance.
 14. The method of claim 12, wherein: thecamera is set at a first focal length when positioned at the firstposition; the camera is set at a second focal length when repositionedat the second position; and the second focal length is greater than thefirst focal length.
 15. The method of claim 12, further comprising, atthe robotic arm: determining a size of the product from the first imageof the surface of the product and the first position of the camera; andbased on the determined size, assigning a working space for the roboticarm.
 16. The method of claim 15, wherein repositioning the camera fromthe first position to the second position is performed within theworking space determined for the robotic arm.
 17. The method of claim12, wherein: the first set of rotatable joints is body rotatable joints;and the second set of rotatable joints is end rotatable joints.
 18. Themethod of claim 12, further comprising, at the robotic arm:repositioning, by actuating the plurality of rotatable joints, thecamera at one or more additional positions, each additional position issubstantially adjacent to a respective additional surface of theproduct; and capturing, via the camera, an additional image of eachrespective additional surface of the product with the camera positionedat the one or more additional positions.
 19. The method of claim 12,wherein: the product is positioned on a rotatable base; the methodfurther comprises, after capturing the first image, rotating therotatable base in accordance with the relative location of the defect inthe first image; and the second image is captured after rotating therotatable base.
 20. A non-transitory computer-readable storage medium,storing one or more programs configured for execution by one or moreprocessors of a robotic arm having a plurality of segments, a camera atan end of the robotic arm, and a plurality of rotatable joints, eachrotatable joint connecting two segments of the plurality of segments orthe camera with one segment of the plurality of segments, the one ormore programs including instructions, which when executed by the one ormore processors cause the robotic arm to: receive a command to capture afirst image of a surface of a product; position, by actuating theplurality of rotatable joints, the camera at a first position that issubstantially adjacent to the surface of the product; capture, via thecamera, the first image of the surface of the product with the camerapositioned at the first position; and after capturing the first image:process the first image to identify a defect in the first image and arelative location of the defect in the first image; determine a secondposition of the camera in accordance with the first position of thecamera and the relative location of the defect in the first image;reposition, by actuating the plurality of rotatable joints, the camerafrom the first position to the second position, wherein the secondposition has a different spatial relationship to the surface of theproduct than the first position; and capture, via the camera, the secondimage of the surface of the product with the camera positioned at thesecond position.